package org.yh;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients//feginclient默认支持ribbon负载均衡
public class ZkOrderApplication {

	public static void main(String[] args) {
		SpringApplication.run(ZkOrderApplication.class, args);
	}

	// @LoadBalanced就能让这个RestTemplate在请求时拥有客户端负载均衡的能力
//	@Bean
//	@LoadBalanced
//	RestTemplate restTemplate() {
//		return new RestTemplate();
//	}
}
